using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class CamerClass : MonoBehaviour
{
    public GameObject player;
    GamePanelModel model;
    public Camera cameras;
    int index = 1;
    int num = 50;
    int textnum = 20;
    
    // Start is called before the first frame update
    void Start()
    {
        model = ModelManager.Ins.GetModel(GamePanelModel.m_name) as GamePanelModel;
    }

    // Update is called once per frame
    void Update()
    {
        transform.position = player.transform.position + player.transform.up * 25/*( (model.GetRoleData("player").nowLevel/5)+25*/;
        transform.LookAt(player.transform.position);
        if (model.GetRoleData("player").nowLevel >num)
        {
            num += (50 * index);
            index++;
            cameras.orthographicSize += 5;
            textnum -= 2;
            for (int i = 0; i < GameObject.Find("Canvas/LextObj").transform.childCount; i++)
            {
                GameObject.Find("Canvas/LextObj").transform.GetChild(i).GetComponent<Text>().fontSize =textnum;
            }
        }
    }
}
